Skip to content

refactor: Rename nodes to n in generators and centr_*_tmax() - #2860

Merged
schochastics merged 17 commits into
claude/issue-2788-subagents-faw1t1from
claude/issue-2788-subagents-faw1t1-2
Dec 3, 2026
Merged

schochastics merged 17 commits into
claude/issue-2788-subagents-faw1t1from
claude/issue-2788-subagents-faw1t1-2

Conversation

@krlmlr

@krlmlr krlmlr commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Part of #2788 (PR 2 of the stack, on top of #2859); executes the nodes → n row of the survey — the direction #692 recorded as essentially uncontested (62 functions already use n).

What this does

Renames the vertex-count argument nodes to n in 16 functions:

  • Game generators (11): sample_grg/grg, sample_pref/pref, sample_asym_pref/asym_pref, sample_traits/traits, sample_traits_callaway/traits_callaway, sample_forestfire.
  • Centralization (4): centr_betw_tmax, centr_clo_tmax, centr_degree_tmax, centr_eigen_tmax. The latter two had no registry entry and no ... yet, so they gain their standard 3.0.0 keyword-only migration here (loops stays required-with-no-default in the tail, unfold_tree() style; the existing loops/scale lifecycle guards are preserved).
  • graph_from_graphdb (1): nodes sits after ..., so this is a pure registry rename (bare-symbol nodes = n in old) — legacy nodes = calls are recovered by the generated block under the usual single soft-deprecation.

nodes is a head formal everywhere else, which the recovery machinery cannot rescue from .... Those functions keep a trailing nodes = deprecated() formal, and their registry entries record the head rename, so the generated block handles it (see #2859): positional calls bind n unchanged (no warning), and a call that names nodes gets a soft-deprecation, with an error when both spellings are supplied. Dot-case wrapper functions (grg.game() etc.) keep their frozen signatures and forward n = nodes.

Selector-nodes functions (ego() family, constraint(), alpha_centrality(), power_centrality()) are deliberately untouched — they rename to vertices in a later PR of this stack.

Notes for review

  • Abbreviated legacy spellings (node =, nod =) of the retired head name now fail loudly with the "spell out the full argument name" guidance instead of partial-matching — same trade-off the attr → weights rename shipped.
  • tests/testthat/_snaps/foreign.md was updated by hand for the renamed error text because graph_from_graphdb() needs network access unavailable in the development sandbox; the offline-renderable messages were verified to match exactly.

The #2788 stack

Each PR is based on the previous one and merges in this order:

  1. refactor: Rename algo to algorithm in page_rank(), feedback_arc_set() and feedback_vertex_set() #2859: algo → algorithm
  2. refactor: Rename nodes to n in generators and centr_*_tmax() #2860: nodes → n (vertex counts) ← this PR
  3. refactor: snake_case weights arguments in clique functions and cluster_infomap() #2861: weights arguments
  4. refactor: Rename normalization flags to normalized #2862: normalization flags → normalized
  5. refactor: Purge legacy alias formals via the migration registry #2863: hand-rolled alias formals into the registry
  6. refactor: Rename vertex-selector arguments to vertices and vertex #2864: selectors → vertices/vertex
  7. refactor: Rename edge-selector arguments to edges #2943: edge selectors → edges
  8. refactor: Rename index to vertices/edges in the attribute accessors #2944: attribute accessors: index → vertices/edges
  9. refactor: Rename iteration arguments to n_iter/max_iter #2945: iterations → n_iter/max_iter
  10. refactor: snake_case the dotted arguments of the graph generators and degree-sequence functions #2946: snake_case: generators and degree sequences
  11. refactor: snake_case the dotted arguments of the layout functions #2947: snake_case: layouts
  12. refactor: snake_case the dotted arguments of the community, HRG, motif and graphlet functions #2948: snake_case: community, HRG, motifs, graphlets (Mu → mu)
  13. refactor: snake_case the dotted arguments of the structural and conversion functions #2950: snake_case: structural and conversion functions
  14. refactor: Rename algorithm-selection arguments to algorithm and measure selection to measure #2951: algorithm family → algorithm/measure (closes Algorithm-selection argument names: census of method/algorithm/algo/impl/implementation #2932)

🤖 Generated with Claude Code

https://claude.ai/code/session_01RTPj4qNv2FWui6etixZeuR


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if b391ca2 is merged into claude/issue-2788-subagents-faw1t1:

  • ✔️as_adjacency_matrix: 759ms -> 762ms [-0.23%, +1.08%]
  • ✔️as_biadjacency_matrix: 765ms -> 765ms [-0.67%, +0.83%]
  • ✔️as_data_frame_both: 1.68ms -> 1.66ms [-3.9%, +1%]
  • ✔️as_long_data_frame: 4.06ms -> 4.08ms [-1.18%, +2.32%]
  • ✔️es_attr_filter: 2.76ms -> 2.73ms [-3.02%, +0.89%]
  • ✔️graph_from_adjacency_matrix: 123ms -> 124ms [-0.7%, +2.48%]
  • ✔️graph_from_data_frame: 3.71ms -> 3.74ms [-0.44%, +1.98%]
  • ✔️vs_attr_filter: 1.57ms -> 1.55ms [-2.55%, +0.98%]
  • ✔️vs_by_name: 1.02ms -> 1.03ms [-2.52%, +3.82%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@krlmlr
krlmlr force-pushed the claude/issue-2788-subagents-faw1t1-2 branch from b391ca2 to 3ad95b8 Compare September 3, 2026 09:57
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if 3ad95b8 is merged into claude/issue-2788-subagents-faw1t1:

  • ✔️as_adjacency_matrix: 788ms -> 789ms [-0.59%, +0.95%]
  • ✔️as_biadjacency_matrix: 777ms -> 775ms [-0.91%, +0.44%]
  • ✔️as_data_frame_both: 1.71ms -> 1.71ms [-1.92%, +1.78%]
  • ✔️as_long_data_frame: 4.25ms -> 4.24ms [-1.88%, +1.37%]
  • ✔️es_attr_filter: 2.81ms -> 2.85ms [-6.05%, +9.65%]
  • ✔️graph_from_adjacency_matrix: 121ms -> 122ms [-0.88%, +1.93%]
  • ✔️graph_from_data_frame: 3.91ms -> 3.85ms [-3.23%, +0.55%]
  • ✔️vs_attr_filter: 1.59ms -> 1.59ms [-1.64%, +1.99%]
  • ✔️vs_by_name: 1.06ms -> 1.04ms [-6.98%, +3.25%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

…2788, #692)

Vertex-count arguments unify on `n`:
11 game generators and their spec twins,
the four `centr_*_tmax()` functions
(`centr_degree_tmax()` and `centr_eigen_tmax()` newly gain
their keyword-only migration on the way),
and `graph_from_graphdb()`.
Head positions keep working positionally;
named `nodes =` callers are soft-deprecated
via surviving sentinel formals or registry recovery.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTPj4qNv2FWui6etixZeuR
@krlmlr
krlmlr force-pushed the claude/issue-2788-subagents-faw1t1-2 branch from 3ad95b8 to 5253256 Compare September 10, 2026 09:03
@github-actions

Copy link
Copy Markdown
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if 5253256 is merged into claude/issue-2788-subagents-faw1t1:

  • ✔️as_adjacency_matrix: 224ms -> 224ms [-0.57%, +1%]
  • ✔️as_biadjacency_matrix: 251ms -> 250ms [-0.88%, +0.38%]
  • ✔️as_data_frame_both: 253ms -> 257ms [-0.18%, +3.22%]
  • ❗🐌as_long_data_frame: 206ms -> 208ms [+0.31%, +1.59%]
  • ✔️es_attr_filter: 242ms -> 241ms [-1.05%, +0.55%]
  • ✔️graph_from_adjacency_matrix: 274ms -> 274ms [-0.93%, +0.68%]
  • ✔️graph_from_data_frame: 273ms -> 272ms [-0.7%, +0.36%]
  • ✔️vs_attr_filter: 293ms -> 295ms [-1.16%, +2.71%]
  • ✔️vs_by_name: 268ms -> 268ms [-2.05%, +2.48%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@github-actions

Copy link
Copy Markdown
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if 3a153fb is merged into claude/issue-2788-subagents-faw1t1:

  • ✔️E_named: 204ms -> 203ms [-1.53%, +0.29%]
  • ✔️V_named: 417ms -> 414ms [-2.32%, +0.73%]
  • ✔️all_simple_paths_named: 125ms -> 125ms [-0.84%, +0.79%]
  • ✔️as_adjacency_matrix: 230ms -> 230ms [-1.08%, +0.4%]
  • ✔️as_biadjacency_matrix: 245ms -> 245ms [-0.46%, +0.94%]
  • ✔️as_data_frame_both: 218ms -> 219ms [-0.03%, +0.53%]
  • ✔️as_long_data_frame: 173ms -> 173ms [-0.46%, +0.37%]
  • ✔️ego_order2_named: 137ms -> 138ms [-0.3%, +1.11%]
  • ✔️es_attr_assign: 221ms -> 220ms [-0.59%, 0%]
  • ✔️es_attr_filter: 225ms -> 225ms [-0.34%, +0.35%]
  • ✔️graph_from_adjacency_matrix: 271ms -> 272ms [-0.26%, +0.35%]
  • ✔️graph_from_data_frame: 244ms -> 244ms [-0.7%, +0.48%]
  • ✔️head_of_named: 155ms -> 155ms [-0.53%, +0.21%]
  • ✔️incident_edges: 162ms -> 163ms [0%, +0.85%]
  • ✔️max_cliques_named: 23.1ms -> 23.4ms [-2.02%, +5.2%]
  • ❗🐌neighbors_by_name: 207ms -> 209ms [+0.38%, +1.2%]
  • ✔️union_named: 211ms -> 212ms [-0.24%, +0.49%]
  • ✔️vs_attr_filter: 236ms -> 236ms [-0.32%, +0.62%]
  • ✔️vs_by_name: 196ms -> 196ms [-0.5%, +0.46%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

…788-subagents-faw1t1-2

# Conflicts:
#	R/foreign.R
#	tests/testthat/_snaps/games.md
#	tests/testthat/test-foreign.R
#	tests/testthat/test-games.R
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if 577ccd4 is merged into claude/issue-2788-subagents-faw1t1:

Status Name Current Incoming Interval
✔️ V_named 337.8ms 340.1ms [-0.75%, +2.07%]
✔️ graph_from_adjacency_matrix 221.1ms 220.9ms [-1.14%, +0.99%]
✔️ graph_from_data_frame 207ms 206.2ms [-1.71%, +0.94%]
✔️ vs_subset_positional 191ms 189ms [-2.29%, +0.17%]
✔️ es_attr_filter 173ms 172.8ms [-0.71%, +0.55%]
✔️ es_attr_assign 171.5ms 170.3ms [-1.62%, +0.28%]
✔️ as_biadjacency_matrix 169ms 169.6ms [-0.46%, +1.18%]
✔️ as_adjacency_matrix 167.3ms 166.6ms [-1.58%, +0.72%]
✔️ E_named 163.3ms 162.8ms [-0.97%, +0.42%]
✔️ vs_by_name 157ms 156.5ms [-1.69%, +0.98%]
✔️ max_cliques_sizes_named 152.5ms 153.1ms [-0.34%, +1.04%]
✔️ as_data_frame_both 145.9ms 145.6ms [-1.31%, +0.98%]
✔️ as_long_data_frame 140.1ms 139.9ms [-0.84%, +0.51%]
✔️ union_named 133ms 132.9ms [-0.75%, +0.62%]
✔️ vs_attr_filter 127.5ms 127.5ms [-0.66%, +0.71%]
✔️ incident_edges 123.7ms 122.9ms [-1.85%, +0.6%]
✔️ head_of_named 112.7ms 112.5ms [-0.59%, +0.23%]
✔️ ego_order2_named 107.2ms 107.2ms [-0.6%, +0.51%]
✔️ neighbors_by_name 95.4ms 95.8ms [-0.4%, +1.13%]
✔️ all_simple_paths_named 95.9ms 95.6ms [-1.15%, +0.47%]
✔️ vs_by_literal_name 69.3ms 69.7ms [-0.19%, +1.09%]
✔️ degree_few_vertices 63.6ms 63.7ms [-0.25%, +0.67%]
✔️ strength_weighted_named 22ms 22ms [-0.63%, +0.86%]
✔️ max_cliques_named 19.4ms 19.3ms [-0.72%, +0.42%]

Further explanation regarding interpretation and methodology can be found in the documentation.

Last updated for commit 577ccd4.

schochastics and others added 4 commits December 2, 2026 19:47
centr_clo_tmax(), centr_eigen_tmax(), graph_from_graphdb(),
sample_asym_pref(), sample_traits(), sample_traits_callaway() and the
grg(), pref(), asym_pref(), traits() and traits_callaway() specs were
renamed without a test that the legacy name still works.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…788-subagents-faw1t1-2

# Conflicts:
#	R/centralization.R
#	R/foreign.R
#	R/games.R
@schochastics schochastics reopened this Dec 3, 2026
schochastics and others added 5 commits December 3, 2026 15:14
The generator now re-matches a call that uses an old head name against the
old signature, so the hand-written `nodes` -> `n` bridges are gone. A call
like `sample_grg(nodes = 10, 0.5, TRUE)` keeps its old meaning (`torus =
TRUE`) instead of failing with "`n` supplied more than once".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schochastics schochastics reopened this Dec 3, 2026
@schochastics
schochastics merged commit c67a3b7 into main Dec 3, 2026
12 checks passed
@schochastics
schochastics deleted the claude/issue-2788-subagents-faw1t1-2 branch December 3, 2026 20:01
schochastics pushed a commit to schochastics/rigraph that referenced this pull request Dec 4, 2026
…graph#2860)

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: David Schoch <david@schochastics.net>
(cherry picked from commit c67a3b7)

R-side fix: snapshot the deprecation through expect_snapshot_igraph(), so the flavor's package name is normalized.
schochastics pushed a commit to schochastics/rigraph that referenced this pull request Dec 4, 2026
…graph#2860)

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: David Schoch <david@schochastics.net>
(cherry picked from commit c67a3b7)

R-side fix: snapshot the deprecation through expect_snapshot_igraph(), so the flavor's package name is normalized.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Algorithm-selection argument names: census of method/algorithm/algo/impl/implementation

3 participants